<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位-相对定位</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }

        .d1{
            background-color: lightblue;
            /* 相对定位 position: relative; + left/right + top/bottom */
            /* 1.相对于原来自己的位置产生移动 2.原来的位置仍然占领 */
            position: relative;
            top: 0;
            left: 0;
            transition: all 1s linear 0s;
        }
        .d2{
            background-color: lightcoral;
            /* 相对定位 position: relative; + left/right + top/bottom */
            position: relative;
            top: 0;
            left: 0;
        }

        .d1:hover{
            left: 100px;
            top:100px;
        }

        .other{
            background-color: green;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="other">参照物，不动</div>
</body>
</html>